home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_sharutils.idb / usr / freeware / info / sharutils.info.z / sharutils.info
Encoding:
GNU Info File  |  1998-05-21  |  21.6 KB  |  577 lines

  1. This is Info file sharutils.info, produced by Makeinfo-1.63 from the
  2. input file sharutils.texi.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Shar utilities: (sharutils).          GNU shar utilities.
  6. * mail-files: (remsync)Invoking mail-files.     Send files to remote site.
  7. * mailshar: (remsync)Invoking mailshar.         Make and send a shell archive.
  8. * remsync: (remsync).                           Synchronize remote files.
  9. * shar: (sharutils)shar invocation.             Make a shell archive.
  10. * unshar: (sharutils)unshar invocation.         Explode a shell archive.
  11. END-INFO-DIR-ENTRY
  12.  
  13.    This file documents the GNU set of shar utilities.
  14.  
  15.    Copyright (C) 1994 Free Software Foundation, Inc.
  16.  
  17.    Permission is granted to make and distribute verbatim copies of this
  18. manual provided the copyright notice and this permission notice are
  19. preserved on all copies.
  20.  
  21.    Permission is granted to copy and distribute modified versions of
  22. this manual under the conditions for verbatim copying, provided that
  23. the entire resulting derived work is distributed under the terms of a
  24. permission notice identical to this one.
  25.  
  26.    Permission is granted to copy and distribute translations of this
  27. manual into another language, under the above conditions for modified
  28. versions, except that this permission notice may be stated in a
  29. translation approved by the Foundation.
  30.  
  31. 
  32. File: sharutils.info,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
  33.  
  34. GNU `shar' utilities
  35. ********************
  36.  
  37.    GNU `shar' makes so-called shell archives out of many files,
  38. preparing them for transmission by electronic mail services.  GNU
  39. `unshar' helps unpacking shell archives after reception.  This is
  40. release 4.2.
  41.  
  42. * Menu:
  43.  
  44. * Introduction::                Introduction to both programs
  45. * shar invocation::             Invoking the `shar' program
  46. * unshar invocation::           Invoking the `unshar' program
  47. * Miscellaneous::               Miscellaneous considerations
  48.  
  49.  -- The Detailed Node Listing --
  50.  
  51. Creating shell archives
  52.  
  53. * Selecting::                   Selecting files
  54. * Splitting::                   Splitting output
  55. * Headers::                     Controlling the shar headers
  56. * Stocking::                    Selecting how files are stocked
  57. * Transmission::                Protecting against transmission
  58. * Kinds::                       Producing different kinds of shar
  59.  
  60. 
  61. File: sharutils.info,  Node: Introduction,  Next: shar invocation,  Prev: Top,  Up: Top
  62.  
  63. Introduction to both programs
  64. *****************************
  65.  
  66.    GNU `shar' makes so-called shell archives out of many files,
  67. preparing them for transmission by electronic mail services.  A "shell
  68. archive" is a collection of files that can be unpacked by `/bin/sh'.  A
  69. wide range of features provide extensive flexibility in manufacturing
  70. shars and in specifying shar *smartness*.  For example, `shar' may
  71. compress files, uuencode binary files, split long files and construct
  72. multi-part mailings, ensure correct unsharing order, and provide
  73. simplistic checksums.  *Note shar invocation::.
  74.  
  75.    GNU `unshar' scans a set of mail messages looking for the start of
  76. shell archives.  It will automatically strip off the mail headers and
  77. other introductory text.  The archive bodies are then unpacked by a
  78. copy of the shell.  `unshar' may also process files containing
  79. concatenated shell archives.  *Note unshar invocation::.
  80.  
  81.    GNU `shar' has a long history.  All along this long road, numerous
  82. users contributed various improvements.  The file `THANKS', from the
  83. GNU `shar' distribution, contain all names still having valid email
  84. addresses, as far as we know.
  85.  
  86.    Please help me getting the history straight, for the following
  87. information is approximative.  James Gosling wrote the public domain
  88. `shar 1.x'.  William Davidsen rewrote it as `shar 2.x'.  Warren Tucker
  89. brought modifications and called it `shar 3.x'.  Richard Gumpertz
  90. maintained it until 1990.  Franc,ois Pinard, from the public domain
  91. `shar 3.49', made `GNU shar 4.x', in 1994.  Some modules and other code
  92. sections were freely borrowed from other GNU distributions, bringing
  93. this `shar' under the terms of the GNU General Public License.
  94.  
  95.    Your feedback helps us to make a better and more portable product.
  96. Mail suggestions and bug reports (including documentation errors) for
  97. these programs to `bug-gnu-utils@prep.ai.mit.edu'.
  98.  
  99. 
  100. File: sharutils.info,  Node: shar invocation,  Next: unshar invocation,  Prev: Introduction,  Up: Top
  101.  
  102. Invoking the `shar' program
  103. ***************************
  104.  
  105.    The format of the `shar' command is one of:
  106.  
  107.      shar [ OPTION ] ... FILE ...
  108.      shar -S [ OPTION ] ...
  109.  
  110.    In the first form, the file list is given as command arguments.  In
  111. the second form, the file list is read from standard input.  The
  112. resulting archive is sent to standard output unless the `-o' option is
  113. given.
  114.  
  115.    Options can be given in any order.  Some options depend on each
  116. other: the `-o' option is required if the `-l' or `-L' option is used.
  117. The `-n' option is required if the `-a' option is used.  Also see `-V'
  118. below.
  119.  
  120.    Some options are special purpose:
  121.  
  122. `--help'
  123.      Print a help summary on standard output, then immediately exits.
  124.  
  125. `--version'
  126.      Print the version number of the program on standard output, then
  127.      immediately exits.
  128.  
  129. `-q'
  130. `--quiet'
  131.      Verbose *off* at `shar' time.  Messages are usually issued on
  132.      standard error to let the user follow the progress, while making
  133.      the archives.  This option inhibits these messages.
  134.  
  135. * Menu:
  136.  
  137. * Selecting::                   Selecting files
  138. * Splitting::                   Splitting output
  139. * Headers::                     Controlling the shar headers
  140. * Stocking::                    Selecting how files are stocked
  141. * Transmission::                Protecting against transmission
  142. * Kinds::                       Producing different kinds of shar
  143.  
  144. 
  145. File: sharutils.info,  Node: Selecting,  Next: Splitting,  Prev: shar invocation,  Up: shar invocation
  146.  
  147. Selecting files
  148. ===============
  149.  
  150. `-p'
  151. `--intermix-type'
  152.      Allow positional parameter options.  The options `-M', `-B', `-T',
  153.      `-z' and `-Z' may be embedded, and files to the right of the
  154.      option will be processed in the specified mode.  Without the `-p'
  155.      option, embedded options would be interpreted as file names.
  156.      *Note Stocking:: for more information on these options.
  157.  
  158. `-S'
  159. `--stdin-file-list'
  160.      Read list of files to be packed from the standard input rather
  161.      than from the command line.  Input must be one file name per line.
  162.      This switch is especially useful when the command line will not
  163.      hold the list of files to be packed.  For example:
  164.  
  165.           find . -type f -print | shar -S -o /tmp/big.shar
  166.  
  167.      If `-p' is specified on the command line, then the options `-M',
  168.      `-B', `-T', `-z' and `-Z' may be included in the standard input
  169.      (on a line separate from file names).  The maximum number of lines
  170.      of standard input, file names and options, may not exceed 1024.
  171.  
  172. 
  173. File: sharutils.info,  Node: Splitting,  Next: Headers,  Prev: Selecting,  Up: shar invocation
  174.  
  175. Splitting output
  176. ================
  177.  
  178. `-o PREFIX'
  179. `--output-prefix=PREFIX'
  180.      Save the archive to files `PREFIX.01' through `PREFIX.NNN' instead
  181.      of standard output.  This option *must* be used when the `-l' or
  182.      the `-L' switches are used.
  183.  
  184.      When PREFIX contains any `%' character, PREFIX is then interpreted
  185.      as a `sprintf' format, which should be able to display a single
  186.      decimal number.  When PREFIX does not contain such a `%'
  187.      character, the string `.%02d' is internally appended.
  188.  
  189. `-l SIZE'
  190. `--whole-size-limit=SIZE'
  191.      Limit the output file size to SIZE times 1024 bytes but don't
  192.      split input files.  This allows the recipient of the shell archives
  193.      to unpack them in any order.
  194.  
  195. `-L SIZE'
  196. `--split-size-limit=SIZE'
  197.      Limit output file size to SIZE times 1024 bytes and split files if
  198.      necessary.  The archives created with this option must be unpacked
  199.      in the correct order.  If the recipient of the shell archives
  200.      wants to put all of them in a single folder, she shall save them
  201.      in the correct order for `unshar', used with option `-e', to
  202.      unpack them all at once.  *Note unshar invocation::.
  203.  
  204.      For people used to saving all the shell archives into a single mail
  205.      folder, care must be taken to save them in the appropriate order.
  206.      For those having the appropriate tools (like Masanobu Umeda's
  207.      `rmailsort' package for GNU Emacs), shell archives can be saved in
  208.      any order, then sorted by increasing date (or send time) before
  209.      massive unpacking.
  210.  
  211. 
  212. File: sharutils.info,  Node: Headers,  Next: Stocking,  Prev: Splitting,  Up: shar invocation
  213.  
  214. Controlling the shar headers
  215. ============================
  216.  
  217. `-n NAME'
  218. `--archive-name=NAME'
  219.      Name of archive to be included in the header of the shar files.
  220.      Also see the `-a' switch further down.
  221.  
  222. `-s ADDRESS'
  223. `--submitter=ADDRESS'
  224.      The `-s' option allows for overriding the email address for the
  225.      submitter, for when the default is not appropriate.  The
  226.      automatically determined address looks like `USERNAME@HOSTNAME'.
  227.  
  228. `-a'
  229. `--net-headers'
  230.      Allows automatic generation of headers:
  231.  
  232.           Submitted-by: ADDRESS
  233.           Archive-name: NAME/partNN
  234.  
  235.      The NAME must be given with the `-n' switch.  If name includes a
  236.      `/', then `/part' isn't used. Thus `-n xyzzy' produces:
  237.           xyzzy/part01
  238.           xyzzy/part02
  239.  
  240.      while `-n xyzzy/patch' produces:
  241.           xyzzy/patch01
  242.           xyzzy/patch02
  243.  
  244.      and `-n xyzzy/patch01.' produces:
  245.           xyzzy/patch01.01
  246.           xyzzy/patch01.02
  247.  
  248. `-c'
  249. `--cut-mark'
  250.      Start the shar with a cut line.  A line saying `Cut here' is
  251.      placed at the start of each output file.
  252.  
  253. 
  254. File: sharutils.info,  Node: Stocking,  Next: Transmission,  Prev: Headers,  Up: shar invocation
  255.  
  256. Selecting how files are stocked
  257. ===============================
  258.  
  259. `-T'
  260. `--text-files'
  261.      Treat all files as text, regardless of their contents.
  262.  
  263. `-B'
  264. `--uuencode'
  265.      Treat all files as binary, use `uuencode' prior to packing. This
  266.      increases the size of the archive. The recipient must have
  267.      `uudecode' in order to unpack.
  268.  
  269.           Use of `uuencode' is not appreciated by many on the net, because
  270.           people like to readily see, by mere inspection of a shell archive,
  271.           what it is about.
  272.  
  273. `-M'
  274. `--mixed-uuencode'
  275.      Mixed mode.  Automatically determine if the files are text or
  276.      binary and archive correctly.  Files found to be binary are
  277.      uuencoded prior to packing.  This option is selected by default.
  278.  
  279.      For a file is considered to be a text file, instead of a binary
  280.      file, all the following should be true simultaneously:
  281.        1. The file does not contain any ASCII control character besides
  282.           BS (backspace), HT (horizontal tab), LF (new line) or FF
  283.           (form feed).
  284.  
  285.        2. The file does not contains a DEL (delete).
  286.  
  287.        3. The file contains no character with its eighth-bit set.
  288.  
  289.        4. The file, unless totally empty, terminates with a LF
  290.           (newline).
  291.  
  292.        5. No line in the file contains more than 200 characters.  For
  293.           counting purpose, lines are separated by a LF (newline).
  294.  
  295. `-z'
  296. `--gzip'
  297.      Use `gzip' and `uuencode' on all files prior to packing.  The
  298.      recipient must have `uudecode' and `gzip' (used with `-d') in
  299.      order to unpack.
  300.  
  301.      Usage of `-z' in net shars will cause you to be flamed off the
  302.      earth.
  303.  
  304. `-g LEVEL'
  305. `--level-for-gzip=LEVEL'
  306.      When doing compression, use `-LEVEL' as a parameter to `gzip'.
  307.      The `-g' option turns on the `-z' option by default.  The default
  308.      value is 9, that is, maximum compression.
  309.  
  310. `-Z'
  311. `--compress'
  312.      Use `compress' and `uuencode' on all files prior to packing.  The
  313.      recipient must have `uudecode' and `compress' (used with `-d') in
  314.      order to unpack.  Option `-C' is a synonymous for `-Z', but is
  315.      deprecated.
  316.  
  317.      Usage of `-Z' in net shars will cause you to be flamed off the
  318.      earth.
  319.  
  320. `-b BITS'
  321. `--bits-per-code=BITS'
  322.      When doing compression, use `-bX' as a parameter to `compress'.
  323.      The `-B' option turns on the `-Z' option by default.  The default
  324.      value is 12, foreseeing the memory limitations of some `compress'
  325.      programs on smallish systems, at `unshar' time.
  326.  
  327. 
  328. File: sharutils.info,  Node: Transmission,  Next: Kinds,  Prev: Stocking,  Up: shar invocation
  329.  
  330. Protecting against transmission errors
  331. ======================================
  332.  
  333.    Transmission of shell archives is not always free of errors.  So one
  334. should make consistency checks on the receiving site.  A very simple
  335. (and unreliable) method is running the UNIX `wc' tool on the output
  336. file.  This can report the number of characters in the file.
  337.  
  338.    As one can guess this does not catch all errors.  Especially
  339. changing of a character value does not change the computed check sum.
  340. To achieve this goal better method were invented and standardized.  One
  341. very strong is MD5 (MD = message digests).  This is standardized in RFC
  342. 1321.  The produced shell scripts do not force the `md5sum' program to
  343. be installed on the system.  This is necessary because it is not yet
  344. part of every UNIX.  The program is however not necessary for producing
  345. the shell archive.
  346.  
  347. `-w'
  348. `--no-character-count'
  349.      Do *not* check with `wc -c' after unpack.  The default is to check.
  350.  
  351. `-D'
  352. `--no-md5-digest'
  353.      Do *not* check with `md5sum' after unpack.  The default is to
  354.      check.
  355.  
  356. `-F'
  357. `--force-prefix'
  358.      Prepend the prefix character to every line even if not required.
  359.      This option may slightly increase the size of the archive,
  360.      especially if `-B' or `-Z' is used.  Normally, the prefix character
  361.      is `X'.  If the parameter to the `-d' option starts with `X', then
  362.      the prefix character becomes `Y'.
  363.  
  364. `-d STRING'
  365. `--here-delimiter=STRING'
  366.      Use STRING to delimit the files in the shar instead of `SHAR_EOF'.
  367.      This is for those who want to personalize their shar files.
  368.  
  369. 
  370. File: sharutils.info,  Node: Kinds,  Prev: Transmission,  Up: shar invocation
  371.  
  372. Producing different kinds of shars
  373. ==================================
  374.  
  375. `-V'
  376. `--vanilla-operation'
  377.      This option produces "vanilla" shars which rely only upon the
  378.      existence of `echo', `test' and `sed' in the unpacking environment.
  379.  
  380.      The `-V' disables options offensive to the "network cop" (or
  381.      "brown shirt").  It also changes the default from mixed mode `-M'
  382.      to text mode `-T'.  Warnings are produced if option `-B', `-z',
  383.      `-Z', `-p' or `-M' is specified (any of which does or might
  384.      require `uudecode', `gzip' or `compress' in the unpacking
  385.      environment).
  386.  
  387. `-P'
  388. `--no-piping'
  389.      In the shar file, use a temporary file to hold the file to
  390.      `uudecode', instead of using pipes.  This option is mandatory when
  391.      you know the unpacking `uudecode' is unwilling to merely read its
  392.      standard input.  Richard Marks wrote what is certainly the most
  393.      (in)famous of these, for MSDOS :-).
  394.  
  395.      (Here is a side note from the maintainer.  Why isnt't this option
  396.      the default?  In the past history of `shar', it was decided that
  397.      piping was better, surely because it is less demanding on disk
  398.      space, and people seem to be happy with this.  Besides, I think
  399.      that the `uudecode' from Richard Marks, on MSDOS, is wrong in
  400.      refusing to handle `stdin'.  So far that I remember, he has the
  401.      strong opinion that a program without any parameters should give
  402.      its `--help' output.  Besides that, should I say, his `uuencode'
  403.      and `uudecode' programs are full-featured, one of the most
  404.      complete set I ever saw.  But Richard will not release his
  405.      sources, he wants to stay in control.)
  406.  
  407. `-x'
  408. `--no-check-existing'
  409.      Overwrite existing files without checking.  If neither `-x' nor
  410.      `-X' is specified, when unpacking itself, the shell archive will
  411.      check for and not overwrite existing files (unless `-c' is passed
  412.      as a parameter to the script when unpacking).
  413.  
  414. `-X'
  415. `--query-user'
  416.      Interactively overwrite existing files.
  417.  
  418.      Use of `-X' produces shars which *will* cause problems with some
  419.      `unshar'-style procedures, particularily when used together with
  420.      vanilla mode (`-V').  Use this feature mainly for archives to be
  421.      passed among agreeable parties.  Certainly, `-X' is *not* for
  422.      shell archives which are to be submitted to Usenet or other public
  423.      networks.
  424.  
  425.      The problem is that `unshar' programs or procedures often feed
  426.      `/bin/sh' from its standard input, thus putting `/bin/sh' and the
  427.      shell archive script in competition for input lines.  As an
  428.      attempt to alleviate this problem, `shar' will try to detect if
  429.      `/dev/tty' exists at the receiving site and will use it to read
  430.      user replies.  But this does not work in all cases, it may happen
  431.      that the receiving user will have to avoid using `unshar' programs
  432.      or procedures, and call `/bin/sh' directly.  In vanilla mode,
  433.      using `/dev/tty' is not even attempted.
  434.  
  435. `-m'
  436. `--no-timestamp'
  437.      Avoid generating `touch' commands to restore the file modification
  438.      dates when unpacking files from the archive.
  439.  
  440.      When the timestamp relationship is not preserved, some files like
  441.      `configure' or `*.info' may be uselessly remade after unpacking.
  442.      This is why, when this option is not used, a special effort is
  443.      made to restore timestamps,
  444.  
  445. `-Q'
  446. `--quiet-unshar'
  447.      Verbose *off* at `unshar' time.  Disables the inclusion of
  448.      comments to be output when the archive is unpacked.
  449.  
  450. `-f'
  451. `--basename'
  452.      Use only the last file name component of each input file name,
  453.      ignoring any prefix directories.  This is sometimes useful when
  454.      building a shar from several directories, or another directory.
  455.      If a directory name is passed to `shar', the substructure of that
  456.      directory will be restored whether `-f' is specified or not.
  457.  
  458. 
  459. File: sharutils.info,  Node: unshar invocation,  Next: Miscellaneous,  Prev: shar invocation,  Up: Top
  460.  
  461. Invoking the `unshar' program
  462. *****************************
  463.  
  464.    The format of the `unshar' command is:
  465.  
  466.      unshar [ OPTION ] ... [ FILE ... ]
  467.  
  468.    Each FILE is processed in turn, as a shell archive or a collection
  469. of shell archives.  If no files are given, then standard input is
  470. processed instead.
  471.  
  472.    Options:
  473.  
  474. `--version'
  475.      Print the version number of the program on standard output, then
  476.      immediately exits.
  477.  
  478. `--help'
  479.      Print an help summary on standard output, then immediately exits.
  480.  
  481. `-d DIRECTORY'
  482. `--directory=DIRECTORY'
  483.      Change directory to DIRECTORY before unpacking any files.
  484.  
  485. `-c'
  486. `--overwrite'
  487. `-f'
  488. `--force'
  489.      Passed as an option to the shar file.  Many shell archive scripts
  490.      (including those produced by `shar' 3.40 and newer) accepts a `-c'
  491.      argument to indicate that existing files should be overwritten.
  492.  
  493.      The option `-f' is provided for a more unique interface.  Many
  494.      programs (such as `cp' and `mv') use this option to trigger the
  495.      very same action.
  496.  
  497. `-e'
  498. `--exit-0'
  499.      This option exists mainly for people who collect many shell
  500.      archives into a single mail folder.  With this option, `unshar'
  501.      isolates each different shell archive from the others which have
  502.      been put in the same file, unpacking each in turn, from the
  503.      beginning of the file towards its end.  Its proper operation
  504.      relies on the fact that many shar files are terminated by a
  505.      `exit 0' at the beginning of a line.
  506.  
  507.      Option `-e' is internally equivalent to `-E "exit 0"'.
  508.  
  509. `-E STRING'
  510. `--split-at=STRING'
  511.      This option works like `-e', but it allows you to specify the
  512.      string that separates archives if `exit 0' isn't appropriate.
  513.  
  514.      For example, noticing that most `.signatures' have a `--' on a
  515.      line right before them, one can sometimes use `--split-at=--' for
  516.      splitting shell archives which lack the `exit 0' line at end.  The
  517.      signature will then be skipped altogether with the headers of the
  518.      following message.
  519.  
  520. 
  521. File: sharutils.info,  Node: Miscellaneous,  Prev: unshar invocation,  Up: Top
  522.  
  523. Miscellaneous considerations
  524. ****************************
  525.  
  526.    Here is a place-holder for many considerations which do not fit
  527. elsewhere, while not worth a section for themselves.
  528.  
  529.    Be careful that the output file(s) are not included in the inputs or
  530. `shar' may loop until the disk fills up.  Be particularly careful when
  531. a directory is passed to `shar' that the output files are not in that
  532. directory (or a subdirectory of that directory).
  533.  
  534.    When a directory is passed to `shar', it may be scanned more than
  535. once, to conserve memory.  Therefore, one should be careful to not
  536. change the directory contents while `shar' is running.
  537.  
  538.    No attempt is made to restore the protection and modification dates
  539. for directories, even if this is done by default for files.  Thus, if a
  540. directory is given to `shar', the protection and modification dates of
  541. corresponding unpacked directory may not match those of the original.
  542.  
  543.    Use of the `-M' or `-B' options will slow down the archive process.
  544. Use of the `-z' or `-Z' options may slow the archive process
  545. considerably.
  546.  
  547.    Let us conclude by a showing a few examples of `shar' usage:
  548.  
  549.      shar *.c > cprog.shar
  550.      shar -Q *.[ch] > cprog.shar
  551.      shar -B -l28 -oarc.sh. *.arc
  552.      shar -f /lcl/src/u*.c > u.sh
  553.  
  554. The first shows how to make a shell archive out of all C program
  555. sources.  The second produces a shell archive with all `.c' and `.h'
  556. files, which unpacks silently.  The third gives a shell archive of all
  557. uuencoded `.arc' files, into files `arc.sh.01' through to `arc.sh.NNN'.
  558. The last example gives a shell archive which will use only the file
  559. names at unpack time.
  560.  
  561.  
  562. 
  563. Tag Table:
  564. Node: Top1338
  565. Node: Introduction2341
  566. Node: shar invocation4325
  567. Node: Selecting5827
  568. Node: Splitting6958
  569. Node: Headers8597
  570. Node: Stocking9762
  571. Node: Transmission12341
  572. Node: Kinds14021
  573. Node: unshar invocation17971
  574. Node: Miscellaneous20084
  575. 
  576. End Tag Table
  577.